import fetch from '@/requests/fetch'
//商品分类
export const getTreeCategory = (data) => fetch('post', '/erp/sassCategory/getTreeForSys', data)
//新增商品分类
export const addSassCategory = (data) => fetch('post', '/erp/sassCategory/addSassCategory', data)
// 编辑商品分类
export const updateSassCategoryById = (data) =>
  fetch('post', '/erp/sassCategory/updateSassCategoryById', data)
//删除商品分类
export const deleteSassCategoryByIds = (data) =>
  fetch('post', '/erp/sassCategory/deleteSassCategoryByIds', data)
//加料商品
export const getAddonOptions = (data) => fetch('post', '/api/erp/sassAddonOptions/page', data)
//新增加料商品
export const addAddonOptions = (data) => fetch('post', '/api/erp/sassAddonOptions/add', data)
// 编辑加料商品
export const updateAddonOptions = (data) => fetch('post', '/api/erp/sassAddonOptions/update', data)
//删除加料商品
export const deleteAddonOptions = (data) => fetch('post', '/api/erp/sassAddonOptions/delete', data)
//商品属性
export const getAttributeDefinitions = (data) => fetch('post', '/api/erp/sassAttributeDefinitions/page', data)
//新增商品属性
export const addAttributeDefinitions = (data) => fetch('post', '/api/erp/sassAttributeDefinitions/add', data)
// 编辑商品属性
export const updateAttributeDefinitions = (data) => fetch('post', '/api/erp/sassAttributeDefinitions/update', data)
//删除商品属性
export const deleteAttributeDefinitions = (data) => fetch('post', '/api/erp/sassAttributeDefinitions/delete', data)
// 新增规格
export const addSassSpecs = (data) => fetch('post', '/api/erp/sassSpecs/addSassSpecs', data)
// 查询规格
export const findSpecsList = (data) => fetch('post', '/api/erp/sassSpecs/findSpecsList', data)


//商品详情
export const getBySpuId = (data) => fetch('get', '/api/erp/sassProducts/getBySpuId', data)
//新增商品
export const addProducts = (data) => fetch('post', '/api/erp/sassProducts/add', data)
// 编辑商品
export const updateProducts = (data) => fetch('post', '/api/erp/sassProducts/update', data)
// 删除商品
export const deleteProducts = (data) => fetch('post', '/api/erp/sassProducts/delete', data)

// 商品列表
export const productPage = (data) => fetch('post', '/api/erp/sassProducts/productPageForSys', data)
// 改价列表
export const pricePage = (data) => fetch('post', '/api/erp/sassProducts/pricePage', data)
// 修改价格
export const updatePrice = (data) => fetch('post', '/api/erp/sassProducts/updatePrice', data)
//商品库存配置表
export const inventoryPage = (data) => fetch('post', '/api/erp/sassInventoryRefillConfig/page',data)

// 修改商品库存配置
export const updateInventory = (data) => fetch('post', '/api/erp/sassInventoryRefillConfig/update', data)
// 上架
export const updatePublish = (data) => fetch('post', '/api/erp/sassProducts/updatePublish',data)
// 统计商品分页数量
export const productPageCount = (data) => fetch('get', '/api/erp/sassProducts/productPageCount', data)
